package problem268;

//268.丢失的数字
//https://leetcode.cn/problems/missing-number/description/

class Solution {
    public int missingNumber(int[] nums) {
        int n = nums.length;
        int ret = 0;
        for(int x : nums) {
            ret ^= x;
        }
        for(int i = 0; i<=n; i++) {
            ret ^= i;
        }
        return ret;
    }
}